﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Chart.aspx.cs" Inherits="QuailDashboard.View.Web.Chart" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html>
  <head>
  <link href="Scripts/redmond/jquery-ui-1.8.5.custom.css" rel="stylesheet" type="text/css" />
<style>
  body
{
    font-size: .75em;
    font-family: Verdana, Helvetica, Sans-Serif;
    margin: 0;
    padding: 0;
    color: #696969;
}
</style>
<script type="text/javascript" src="https://www.google.com/jsapi"></script>
<script type="text/javascript">
        google.load("jquery", "1");
        google.load("jqueryui", "1");
        google.load("visualization", "1", { packages: ["corechart"] });
        google.setOnLoadCallback(onLoadCallback);

        function onLoadCallback() {
            $("#tabs").tabs();
            /* $("#tabs").tabs("select", 0); */
            <%=CurrentTab%>

            <% WriteData(); %>
        }

        /*
        $(document).ready(function(){
            alert($("#chart3RefreshBtn"));
            alert($("#chart3form"));

            
           $("#chart3RefreshBtn").click($.get('Chart.aspx', function(data) {
              $("#chart3form").html(data);
           }));
           
        });
        */

</script>
<title><%=PageTitle%></title>
</head>
<body>

<div id="tabs">
        <ul id="tabs-ul">
            <li><a href="#chart1_div">By Date</a></li>
            <li><a href="#chart2_div">Worst Offenders</a></li>
            <li><a href="#chart3_div">Metrics</a></li>
        </ul>

    <div id="chart1_div"></div>
    <div id="chart2_div"></div>
    <div id="chart3_div">
        <form action="Chart.aspx" method="get" name="chart3form" id="chart3form">
        <h2>Options</h2>
            <p>Project: <select name="lib" id="lib"><%=GetLibraryNameSelectOptions()%></select></p>
            <p>Environment: <select name="env" id="env"><%=GetEnvironmentSelectOptions()%></select></p>
            <p>Failure Greater than %: <input type="text" value="<%=PercentFailed%>" name="pctf" id="pctf" /></p>
            <p>Date Range: <input type="text" value="<%=FromDate%>" name="start" id="start"/> to <input type="text" value="<%=ToDate%>" name="end" id="end"/><br /></p>
            <p><input type="submit" name="chart3RefreshBtn" id="chart3RefreshBtn" value="Refresh" /><input type="hidden" name="pgload" value="2" /></p>
        </form>
        <hr />
        <div id="chart3_results">
            <%=MetricsTable%>
        </div>
    </div>
</div>

  </body>

</html>
